/*
 * Class3I.h
 *
 *  Created on: 2015年7月16日
 *      Author: Administrator
 */
#include "Class3.h"
#ifndef BCCH_CLASS3I_H_
#define BCCH_CLASS3I_H_

//包含idle mode下的许多参数。Size: 120 bits
//
//<Header: bitstring(5)>– 5 bits
//<Class Type 3: 0>
//<Segment type: 1001>
//struct ST3I_Header{
//	//header 由classType、segment Type组成
//	//1 bit
//	unsigned char classType:1;
//	//4bits
//	unsigned char segmentType:4;
//};
//<LA Information Class 3>– 55 bits
//<Spare: bitstring(2)>
//<SA_CBCH_CONFIG: bitstring(5)>– Bitmap of CCBCH frame pairs in use.See GMR-1 05.002
//<SA_CBCH_RF: bitstring(11)>– ARFCN of the CBCH. Range 1 - 1 087."11111111111" signifies that there is no CBCH
//<SA_CBCH_TS: bitstring(5)>– Starting timeslot of CBCH channel on BCCH carrier.Range 0 - 23. Should be set to 0 if there is no CBCH
//<Pause Time: bitstring(8)>– Value of T3115 in 100 msec units
//<RACH Access Timer: bitstring(8)>– Value of T3126 in 100 msec units
//<Alert Timer: bitstring(8)>– Value of Alert Timer (T3112) in 1-second units
//<Page Timer: bitstring(8)>– Value of Page Timer in 1-second units
//<Almanac Present: bitstring(1)>– Flag to indicate the presence of almanac data on the PCH
//– 1 PCH contains almanac data
//– 0 PCH does not contain almanac data
struct LAInfo{
	unsigned char spare:2;
	unsigned char SA_CBCH_CONFIG:5;
	unsigned short SA_CBCH_RF:11;
	unsigned char SA_CBCH_TS:5;
	unsigned char PauseTime;
	unsigned char RACHAccessTimer;
	unsigned char  AlertTimer;
	unsigned char  PageTimer;
	unsigned char AlmanacPresent:1;
};

//<Position Parameters>– 43 bits
//	<RACH Position Timer: bitstring(8)>– In 100 milliseconds
//	<GPS Update Timer: bitstring(8)>– In 3-minute increments. Value 0 indicates that no periodic GPS measurements shall be required
//	<GPS Update Distance: bitstring(8)>– In kilometers. Value 0 indicates that the distance should not be checked for position reporting
//	<GPS Position Age: bitstring(8)>– In 6-minute increments; applicable for all accesses except MT calls
//	<Page GPS Position Age: bitstring(8)>– In 6-minute increments; applicable for MT calls
//	<Page Response Current GPS: bitstring(1)>– Applicable to MT calls only
//	– 0 Use RACH Position timer
//	– 1 Use Page Timer/Alert timer
//	<Position Reporting Required: bitstring(2)>– Specifies the GPS usage and reporting (see GMR-1 03.299 [9] for specific requirements)
//	– 00 Required
//	– 01 Optional
//	– 10NoReporting
//	– 11: GPS forbidden
struct PositionPara{
	unsigned char RACHPositionTimer;
	unsigned char GPSUpdateTimer;
	unsigned char GPSUpdateDistance;
	unsigned char GPSPositionAge;
	unsigned char PageGPSPositionAge;
	unsigned char PageResponseCurrentGPS:1;
	unsigned char PositionReportingRequired:2;
};
class Class3I :public Class3{
public:
	Class3I();
	virtual ~Class3I();
//	ST3I_Header header;
	LAInfo laiInfo;
	//<Periodic LU Timer: bitstring(8)>– Value of the timer T3212. Range 0 - 1 530 minutes in units of 6 minutes
	unsigned char PeriodicLUTimer;
	//<Dual Mode Hold Timer: bitstring(3)>– Range 15 - 120 minutes in units of 15 minutes
	unsigned char DualModeHoldTimer:3;
	PositionPara positionPara;
	//<Spare: bitstring(6)– 6 bits
	unsigned char spare:6;
};

#endif /* BCCH_CLASS3I_H_ */
